package com.example.c97s3plystartermybatis;


import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

//@PropertySource("classpath:db.properties")   //存Environment对象
@Component            //spring会托管这个类的对象     <bean id="dataSourceconfig" class="" />  IOC....
@Data                //  get()/set()
//@Configuration       //配置文件
@ConfigurationProperties(prefix = "spring.datasource")
public class DataSourcesConfig {
    //@Value("${jdbc.username}")
    private String username;

    //@Value("${jdbc.password}")  // $xxx 占位符
    private String password;

    //@Value("${jdbc.url}")
    private String url;

    //@Value("${jdbc.driverName}")
    //private String driverName;
    private String driverClassName;
}

